<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <% String path = request.getContextPath();%>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>找回密码</title>
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" href="<%=path %>/assets/images/favicon-32x32.png">
    <!-- Base Styling  -->
    <link rel="stylesheet" href="<%=path %>/assets/main/css/fonts.css">
    <link rel="stylesheet" href="<%=path %>/assets/main/css/style.css">
</head>

<body>
    <div id="main-wrapper" class="show">

        <div class="login-tabib">
            <div>
                <div class="text-center">
                    <a class="logo" >
                        <img class="img-fluid" src="<%=path %>/assets/images/logo.png" alt="loogin page">
                    </a>
                </div>
                <div class="login-main">
                    <form class="theme-form">
                        <h4>请输入您的账号 </h4>
                        <div class="form-group m-b-10">  
                            <div class="form-input position-relative">
                                <input class="form-control" name="username" type="text" placeholder="输入您的账号" id="username">
                                <div class="show-hide"><span class="show"></span></div>
                            </div>
                        </div>
                        <div class="form-group mb-0">
                            <div class="mt-3">
                            	
                                <button class="btn btn-primary w-100" id="next" type="button">下一步</button>
                             </div>
                        </div>
                        <p class="mt-4 mb-0">记起您的密码?<a class="ms-2 text-primary text-center" href="<%=path%>/web/userLogin.jsp">登录</a>
                        </p>
                    </form>
                </div>
            </div>
        </div>

    </div>
                        
    <!-- JQuery v3.5.1 -->
    <!-- <script src="<%=path %>/assets/plugins/jquery/jquery.min.js"></script> -->
	<script src="<%=path %>/js/jquery-3.6.0.min.js"></script> 
    <!-- popper js -->
    <script src="<%=path %>/assets/plugins/popper/popper.min.js"></script>

    <!-- Bootstrap -->
    <script src="<%=path %>/assets/plugins/bootstrap/js/bootstrap.js"></script>

    <!-- Moment -->
    <script src="<%=path %>/assets/plugins/moment/moment.min.js"></script>

    <!-- Date Range Picker -->
     <script src="<%=path %>/assets/plugins/daterangepicker/daterangepicker.min.js"></script> 

    <!-- Main Custom JQuery -->
    <script src="<%=path %>/assets/js/toggleFullScreen.js"></script>
    <script src="<%=path %>/assets/js/main.js"></script>

</body>

<script type="text/javascript">
var path = "${pageContext.request.contextPath}";  

	function forget(){
			var username = $("#username").val();
			console.log(username)
			$.ajax({
				url:path+"/ForgetController",
				type:"post",
				data:{"action":"isExist","username":username},
				success:function(mes){
					if(mes=="have"){ 
						location.href=path+"/ForgetController?action=showQuestion&username="+username;
					}
					else{
						alert("账号不存在！")
					}
				}
			});
		}
	
		$(function(){
			$("#next").on("click",forget);
		});
	
</script>
</html>